<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>倒计时1</title>
    <link rel="stylesheet" href="../css/common.css">
    <style>
        #box {
            width: 200px;
            height: 50px;
            background-color: red;
            margin: 200px auto;
        }

        #box>div {
            padding: 0px 8px;
            font-size: 18px;
            font-weight: bold;
            color: white;
        }

        .h,
        .m,
        .s {
            background-color: #000000;
        }
    </style>
</head>

<body>
    <div id="box" class="flex a-c j-c">
        <div class="h">11</div>
        <div>:</div>
        <div class="m">44</div>
        <div>:</div>
        <div class="s">22</div>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <script src="../js/bing.js"></script>
    <script>
        setInterval(() => {
            let start = new Date()
            let end = new Date('2020-11-23 16:30:30')
            let ms = end - start  //返回两日期之间的毫秒数
            let h = Math.floor(ms / 1000 / 3600)
            let m = Math.floor(ms / 1000 % 3600 / 60)
            let s = Math.floor(ms / 1000 % 60)
            $('.h').text($.repair0(h))
            $('.m').text($.repair0(m))
            $('.s').text($.repair0(s))
        }, 500);
    </script>
</body>

</html>